package com.itheima.Demo;

import java.util.HashMap;
import java.util.Map;

public class DemoMap02常用方法 {
    public static void main(String[] args) {
        //创建对象;
        Map<String ,String > map  =  new HashMap<>();
        //添加键对值;
        map.put("柳岩","大鹏");
        map.put("罗志祥","周扬青");
        map.put("小岳岳","孙悦");
        //boolean containsKey(Object key)
        //判断是否包含某个键
        boolean s = map.containsKey("张晗");
        System.out.println(s);
        boolean s2 = map.containsKey("罗志祥");
        System.out.println(s2);
        //boolean containsValue(Object value)
        //判断是否包含某个值
        boolean s3 = map.containsValue("张梓墨");
        System.out.println(s3);
        boolean s4 = map.containsValue("大鹏");
        System.out.println(s4);
    }
}
